﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Justin.Stock.Models
{
    public class StockInfo
    {
        public string Code { get; set; }
        public string No { get; set; }
        public string Name { get; set; }
        public string SpellingInShort { get; set; }
        public decimal WarnPrice_Min { get; set; }
        public decimal WarnPrice_Max { get; set; }
        public decimal WarnPercent_Max { get; set; }
        public decimal WarnPercent_Min { get; set; }
        public decimal BuyPrice { get; set; }
        public int BuyCount { get; set; }
        public bool ShowInFolatWindow { get; set; }
        public decimal ProfitOrLoss
        {
            get
            {
                ////
                decimal temp;
                if (BuyCount >= 0)
                {
                    if (PriceNow != 0)
                    {
                        temp = (PriceNow - BuyPrice) * BuyCount;
                    }
                    else
                    {
                        temp = (PriceYesterdayEnd - BuyPrice) * BuyCount;
                    }
                }
                else
                {
                    temp = 0;
                }

                return Math.Round(temp, 0);

            }
        }



        #region 实时数据

        public decimal PriceTodayStart { get; set; }
        public decimal PriceYesterdayEnd { get; set; }
        public decimal PriceNow { get; set; }
        public decimal PriceTodayHigh { get; set; }
        public decimal PriceTodayLow { get; set; }
        public long DealsStockAmt { get; set; }
        public decimal DealsMoney { get; set; }
        public string DateTime { get; set; }
        public DateTime Now { get; set; }

        public decimal SurgedRange
        {
            get
            {
                if (PriceYesterdayEnd != 0)
                {

                    return Math.Round((PriceNow - PriceYesterdayEnd) / PriceYesterdayEnd * 100, 2);
                }
                else
                {
                    return 0;
                }
            }
        }

        public decimal TurnOver { get; set; }

        public int Buy1Count { get; set; }
        public int Buy2Count { get; set; }
        public int Buy3Count { get; set; }
        public int Buy4Count { get; set; }
        public int Buy5Count { get; set; }

        public decimal Buy1Price { get; set; }
        public decimal Buy2Price { get; set; }
        public decimal Buy3Price { get; set; }
        public decimal Buy4Price { get; set; }
        public decimal Buy5Price { get; set; }


        public int Sell1Count { get; set; }
        public int Sell2Count { get; set; }
        public int Sell3Count { get; set; }
        public int Sell4Count { get; set; }
        public int Sell5Count { get; set; }

        public decimal Sell1Price { get; set; }
        public decimal Sell2Price { get; set; }
        public decimal Sell3Price { get; set; }
        public decimal Sell4Price { get; set; }
        public decimal Sell5Price { get; set; }

        #endregion
    }


}
